var express = require('express');
var router = express.Router();
var hget=require('../util/http_get_util.js');
var hpost=require('../util/http_post_util.js');
/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Express' });
});

/* 测试从java端获取数据 */
router.get('/aabbcc', function(req, res, next) {

  res.render('index', { title: 'Express' });
  hget("http://localhost:9999/haha").then(function(data){//成功时走这个
  	res.send(data);
  },function (e) {//失败时走这个
  	console.log(e);
  });


  // hpost("http://localhost:9999/haha",{name:"张三",age:18}).then(function (data) {
  // 	res.send(data);
  // },function (e) {
  // 	console.log(e);
  // });



});




module.exports = router;
